#ifndef __OTYPES_H__
#define __OTYPES_H__
#include "const/oPreDefine.h"

#define GROUP_ME oGroup::one
#define GROUP_BLOCK_ME oGroup::two
#define GROUP_ENEMY oGroup::three
#define GROUP_BLOCK_ENEMY oGroup::four
#define GROUP_POKE_ME oGroup::five
#define GROUP_POKE_ENEMY oGroup::six
#define GROUP_TERRAIN oData::sharedData().getTerrainGroup()
#define GROUP_HIDE_ME oGroup::seven
#define GROUP_HIDE_ENEMY oGroup::eight
#define GROUP_RECT oGroup::nine

#define TAG_SWITCH 1
#define TAG_SWITCHG 2
#define TAG_BRICK 3
#define TAG_BUNNY 4
#define TAG_HERO 5
#define TAG_POKE 6


#define LAYER_BACKGROUND_ID -1
#define LAYER_BRICK_ID 0
#define LAYER_SWITCH_ID 1
#define LAYER_BUNNY_ID 2
#define LAYER_HERO_ENEMY_ID 3
#define LAYER_HERO_ME_ID 4
#define LAYER_FOREGROUND_ID 5
#define LAYER_README_ID 6

#define EFFECT_BLOOD 1
#define EFFECT_HEART 2
#define EFFECT_POKEBOOM 3
#define EFFECT_SELECT 4

#define ACTION_SWITCH_IDLE oID::ActionUser+0
#define ACTION_SWITCH_PUSH oID::ActionUser+1
#define ACTION_BRICK_HIT oID::ActionHit
#define ACTION_BRICK_DIE oID::ActionUser+2
#define ACTION_ROLE_SWITCH oID::ActionUser+3
#define ACTION_ROLE_STRIKE oID::ActionUser+4
#define ACTION_POKE oID::ActionUser+5

#define TARGET_SCREEN_WIDTH 960.0f
#define TARGET_SCREEN_HEIGHT 640.0f

#if CC_TARGET_PLATFORM == CC_PLATFORM_WIN32
	#define GAME_KEY_UP VK_UP
	#define GAME_KEY_DOWN VK_DOWN
	#define GAME_KEY_LEFT VK_LEFT
	#define GAME_KEY_RIGHT VK_RIGHT
	#define GAME_KEY_F 'F'
#else
	#define GAME_KEY_UP 0
	#define GAME_KEY_DOWN 1
	#define GAME_KEY_LEFT 2
	#define GAME_KEY_RIGHT 3
	#define GAME_KEY_F 4
#endif

#define MAX_MANA 6
#define MAX_BUNNY 5

#define FONT_NAME "Thonburi"
#define FONT_SIZE 36

inline float oGetSwitchFlag(int switchTag, bool switchAtRight)
{
	uint32 flag = (uint32)switchTag | ((uint32)switchAtRight) << 8;
	return (float)flag;
}
inline int oGetSwitchTag(float prop)
{
	uint32 flag = (uint32)prop;
	return flag &= 0xff;
}
inline bool oGetSwitchAtRight(float prop)
{
	uint32 flag = (uint32)prop;
	return (flag>>8) == 0;
}

struct oStr
{
	static const string IsAtSwitch;
	static const string SwitcherID;
	static const string noweapon;
};

struct oGameEventName
{
	static const string PushSwitch;
};

const string oNumberStr[] = {"0","1","2","3","4","5","6","7","8","9","10"};

#endif
